/**
 * Author:yuiop
 * Date:2022/9/1 15:16
 */
package com.devops.admin.collector;

import com.devops.admin.service.DOSMetricsService;
import io.prometheus.client.Collector;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.ArrayList;
import java.util.List;

public class OtherPlatformCollector extends Collector {
    @Autowired
    DOSMetricsService dosMetricsService;
    @Override
    public List<MetricFamilySamples> collect() {
        List<MetricFamilySamples> mfs = new ArrayList<MetricFamilySamples>();
        if (dosMetricsService != null) {
            List<MetricFamilySamples> list = dosMetricsService.getAllMetrics();
            mfs.addAll(list);
        }
        return mfs;
    }
}
